/* Copyright (c) 2025 LiuZiyao
*    Key Laboratory of Cyberspace Security Defense,Institute of Information Engineering, CAS
*    School of Cyber Security, University of Chinese Academy of Sciences     
*
* This file is part of the openHiTLS project.
*
* openHiTLS is licensed under the Mulan PSL v2.
* You can use this software according to the terms and conditions of the Mulan PSL v2.
* You may obtain a copy of Mulan PSL v2 at:
*
*     http://license.coscl.org.cn/MulanPSL2
*
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
* See the Mulan PSL v2 for more details.
*/

#include "polar.h"
#include "ecc.h"
#include <string.h>
#include <stdlib.h>

//error corretion encode(polar)
int polar_ecc_enc(uint8_t *d) // d:source sequence 
{
	/* polar */
	encode_polar(d);
	
	return 0;
}

//error corrction decode(polar)
int polar_ecc_dec(uint8_t *d, const double *c) // d:estimated message c:LLR of the received signal
{
	/*polar*/
	decode_polar(d, c);
	
	return 0;
}